package edu.sctu.jarime.may.day20150517;



/**
 * Created by user19 on 2015/5/18.
 */
public class TextOne extends TextMore{

    public TextOne(TeaCher[] teacher) {

        super(teacher);
    }



    /***
     * 老师学号排序后输出老师信息，
     */
    public void getTercherInfo(){

        TeaCher[] teacher=sortNumber();
        System.out.println(teacher[0].number + ":" + teacher[1].number);
    }

    /***
     *处理学生成绩排序后的成绩大于coed的学生
     * @param code
     * @param student
     * @return
     */

    public Student[] getStudent(int code, Student[] student){
        Student[] students = teacher[0].students;
        Student[] students1 = teacher[1].students;

        sortStudent(students);
        sortStudent(students1);
        Student[] studentscore=new Student[6];
        int k=-1;

        for (int i = 0;i <students.length;i ++){
            if (students[i].score > code){
                k++;
                studentscore[k] = students[i];
            }
        }
        for (int i = 0;i <students1.length;i ++){
            if (students1[i].score > code){
                k++;
                studentscore[k] = students[i];
            }
        }
        for (int i=0;i<studentscore.length;i++) {
            if (studentscore != null) {
                System.out.println(studentscore[i].name+":"+studentscore[i].score);

            }
        }

        return studentscore;
    }

    /***
     *判断职称为教授的学生有哪些
     * @return
     */
    public Student[] getCode(){
        TeaCher teacher = pritCoded();
        Student[] studentnumber = interFace.Student(teacher.students);

        return studentnumber;
    }

    Port interFace = new Port() {
        @Override
        public Student[] Student(Student[] Student) {

            Student[] studentnumber = getStudent(60,Student);

            return studentnumber;
        }
    };

    /***
     * 输出学生所选的共同课程最多的课程是哪些，选择的学生有哪些
     */

//    public void getCourse(){
//        TextDate textDate =new TextDate();
//        int a=0;//选计算机的人数
//        int b=0;//选语文的人数
//        int c=0;//选数学的人数
//        int d=0;//选物理的人数
//        int e=0;//选生物的人数
//       for (int i=0;i< textDate.courses.length;i++){
//           if (textDate.courses[i].equals("计算机")){
//               a++;
//           }if (textDate.courses[i].equals("语文")){
//               b++;
//           }if (textDate.courses[i].equals("数学")){
//               c++;
//           }if (textDate.courses[i].equals("物理")){
//               d++;
//           }else{
//               e++;
//           }
//           System.out.println(a);
//       }
//
//        int max=a;
//
//
//    }
    public boolean is_sanhao(boolean studentis_sanhao) {
        for (int i = 0; i < teacher[0].students.length; i++) {
            if (teacher[0].students[i].score > 90) {
                studentis_sanhao = true;
            }
        }
        return studentis_sanhao;
    }


    public void getStudentAdress(){

    }

}
